import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { glslify } from 'vite-plugin-glslify'
console.log('glslify: ', glslify)


import path from 'path'

function pathResolve(dir) {
	return path.resolve(__dirname, dir)
}

export default defineConfig({
  resolve: {
		alias: {
			'@': pathResolve('src')
		}
	},
  plugins: [vue(), glslify()],
  server: {
    // port: 8080,
    open: true,
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    },
  },
})
